@{
    ViewData["Title"] = "林场管理系统";
}

@model WebApplication11.Models.message

<div class="jumbotron">
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">
                <p>欢迎 @if (ViewBag.Identity != 0)
                      {
                          <a> @ViewBag.Identity 个林区的管理员 </a>
                      } @ViewBag.username</p>
            </h3>
        </div>
        @using (Html.BeginForm("destory", "detail"))
        {
            <div style="text-align: center">
                <input class="btn btn-primary" type="submit" value="注销"/>
                @* 使用onclick更改action从而访问不同后端接口 *@
            </div>
        }
        <div class="panel-body">
            <table class="table table-striped" style="table-layout: fixed">
                <thead>
                <tr>
                    <th>属性</th>
                    <th>信息</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <th>用户名</th>
                    <th>@ViewBag.username</th>
                    <th><input class = "form-control" value="不可更改"  readonly="readonly"/></th>
                </tr>
                <tr>
                    <form action="~/detail/changePassword" method="post">
                        <th> 密码 </th>
                        <th><input class = "form-control" name="password"/></th>
                        <th><input class="btn btn-primary col-sm-offset-1" type="submit" value="修改"/></th>
                    </form>
                </tr>
                </tbody>
            </table>
            <table class="table table-striped" style="table-layout: fixed">
                <thead>
                <tr>
                    <th>林区</th>
                    <th>负责情况</th>
                </tr>
                </thead>
                <tbody>
                @foreach (var item in (List<forest>)ViewBag.Forests)
                {
                    <tr>
                        <td>
                            @item.Name
                        </td>
                        <td>
                            @if (@item.Lead)
                            {
                                <a>管理员</a>
                            }
                            else
                            {
                                <a>守林员</a>
                            }
                        </td>
                    </tr>
                }
                </tbody>
            </table>
        </div>
    </div>
</div>